/*******************************************************************************
 * File name: hdr_cpsr.h
 * Description: header file with bit definitions for CPSR register of LPC2478
 * Project: Pattern
 * Target: LPC2478
 * Compiler: arm-none-eabi-gcc
 * Date: 2010-06-02
 * Author: Freddie Chopin
 * Based on: http://freddiechopin.info
 *******************************************************************************/

#ifndef HDR_CPSR_H_
#define HDR_CPSR_H_

/*==============================================================================
 Defines
==============================================================================*/
/* Operation modes */
# define USER_MODE			0b10000			/* User mode */
# define FIQ_MODE				0b10001			/* FIQ mode */
# define IRQ_MODE				0b10010			/* IRQ mode */
# define SUPERVISOR_MODE	0b10011			/* Supervisor mode */
# define ABORT_MODE			0b10111			/* Abort mode */
# define UNDEFINED_MODE		0b11011			/* Undefined mode */
# define SYSTEM_MODE			0b11111			/* System mode */

/* Interrupt bits */
# define CPSR_I_bit			7
# define CPSR_F_bit			6

# define CPSR_I				(1 << CPSR_I_bit)	/* clear - IRQs enabled, set - disabled */
# define CPSR_F				(1 << CPSR_F_bit)	/* clear - FIQs enabled, set - disabled */

#endif /* HDR_CPSR_H_ */

/******************************************************************************
* END OF FILE
******************************************************************************/
